package com.desksoft.ecommerce.vo.mp;

import java.io.Serializable;
import java.util.Map;
import java.util.Set;

import javax.mail.Address;

import com.desksoft.ecommerce.constants.Constants;

/***************************************
 * 版权所有：杭州迪科软件 保留所有权利
 * 创建日期: 
 * 创建作者：yejw
 * 文件名称：
 * 版本：
 * 功能：
 * 最后修改时间：
 * 修改记录：
 *****************************************/
public class MailSendVO extends MailSendSimpleVO implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 93399344754065861L;
	
	public final static byte SEND = 0;
	
	public final static byte SAVE = 1;
	
	/**
	 * 发送保存标记
	 */
	private byte sendSaveFlag = SEND;
	
	/**
	 * pop验证标记
	 */
	private boolean popAuthFlag = false;
	
	/**
	 * 服务器名称 
	 */
	private String smtpHost ;
	
	/**
	 * 发件人ID
	 */
	private Long userId;

	/**
	 * 原始邮件编号
	 */
	private Long originalId;
	/**
	 * 用户名(数据库用户名)
	 */
	private String userName;

    /**
     * 发送类型，按地址发送还是常规发送
     */
    private byte sendType = Constants.MAIL_SEND_TYPE_DEFAULT;

    /**
     * 邮件附件列表
     */
	private Set<String> mailAttachSet;
    
    /**
     * 除附件外的其它文件，如邮件图片等
     */
    private Map<String, String> otherFileMap;
    
	/**
	 * 抄送人列表
	 */
	private Address[] mailCC;
	/**
	 * 密送人列表
	 */
	private Address[] mailBCC;
    
    /**
     * 文本内容
     */
    private String txtContext;
    
	/**
	 * 邮件内容格式
	 * 0：html的格式常量
	 * 1：文本格式常量
	 * 2：正常格式
	 */
	private int codeFlag = 0; 
    /**
     * 是否要求回执（默认为不需要）
     */
    private boolean isAskReply = false;
    
    /**
     * 严重等级
     */
    private String priorityLevel;
    
    /**
     * 是否保存到已发送
     */
    private boolean saveToDra;
    
    /**
     * 是否有广告
     */
    private boolean hasAd = false;
    
    /**
     * 原始邮件附件的总大小(不包括已经删除的)
     */
    private long orignalMailAttachSize = 0;
    
    /**
     * 邮件发送后空间变化大小
     */
    private long spaceChangeSize = 0;

    /**
     * 返回 Level
     * 
     * @return String
     */
    public String getPriorityLevel() {
        return this.priorityLevel;
    }

    /**
     * @param p_notificationLevel
     */
    public void setPriorityLevel(String p_notificationLevel) {
        this.priorityLevel = p_notificationLevel;
    }

	/**
	 * @return
	 */
	public Set<String> getMailAttachSet() {
		return mailAttachSet;
	}

	/**
	 * @return
	 */
	public Address[] getMailBCC() {
		return mailBCC;
	}

	/**
	 * @return
	 */
	public Address[] getMailCC() {
		return mailCC;
	}

	/**
	 * @return
	 */
	public byte getSendType() {
		return sendType;
	}

	/**
	 * @param p_set
	 */
	public void setMailAttachSet(Set<String> p_set) {
		mailAttachSet = p_set;
	}

	/**
	 * @param p_strings
	 */
	public void setMailBCC(Address[] p_strings) {
		mailBCC = p_strings;
	}

	/**
	 * @param p_strings
	 */
	public void setMailCC(Address[] p_strings) {
		mailCC = p_strings;
	}

	/**
	 * @param p_string
	 */
	public void setSendType(byte p_string) {
		sendType = p_string;
	}
	/**
	 * @return
	 */
	public int getCodeFlag() {
		return codeFlag;
	}

	/**
	 * @param p_i
	 */
	public void setCodeFlag(int p_i) {
		codeFlag = p_i;
	}

    /**
     * 返回 otherFileMap
     * @return  Map 返回otherFileMap 
     */
    public Map<String, String> getOtherFileMap() {
        return this.otherFileMap;
    }

    /**
     * 设置 otherFileMap 
     * @param p_otherFileMap Map 设置otherFileMap
     */
    public void setOtherFileMap(Map<String, String> p_otherFileMap) {
        this.otherFileMap = p_otherFileMap;
    }

    /**
     * 返回 txtContext
     * @return  String 返回txtContext 
     */
    public String getTxtContext() {
        if (this.txtContext == null) {
            this.txtContext = "";
        }
        return this.txtContext;
    }

    /**
     * 设置 txtContext 
     * @param p_txtContext String 设置txtContext
     */
    public void setTxtContext(String p_txtContext) {
        this.txtContext = p_txtContext;
    }

    /**
     * 返回 isAskReply
     * @return  boolean 返回isAskReply 
     */
    public boolean isAskReply() {
        return this.isAskReply;
    }

    /**
     * 设置 isAskReply 
     * @param p_isAskReply boolean 设置isAskReply
     */
    public void setAskReply(boolean p_isAskReply) {
        this.isAskReply = p_isAskReply;
    }

	/**
	 * 是否有广告
	 * @return the hasAd
	 */
	public boolean isHasAd() {
		return hasAd;
	}

	/**
	 * @param hasAd the hasAd to set
	 */
	public void setHasAd(boolean hasAd) {
		this.hasAd = hasAd;
	}

    /**
     * @return the userId
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * @param userId the userId to set
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * @return the userName
     */
    public String getUserName() {
        String name = userName;
        if (name==null){
            name = this.authAccount;
        }
        if (name==null){
            throw new NullPointerException("未指定userName 或  authAccount属性");
        }
        return name;
    }

    /**
     * @param userName the userName to set
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * @return the orignalMailAttachSize
     */
    public long getOrignalMailAttachSize() {
        return orignalMailAttachSize;
    }

    /**
     * @param orignalMailAttachSize the orignalMailAttachSize to set
     */
    public void setOrignalMailAttachSize(long orignalMailAttachSize) {
        this.orignalMailAttachSize = orignalMailAttachSize;
    }

    /**
     * @return the spaceChangeSize
     */
    public long getSpaceChangeSize() {
        return spaceChangeSize;
    }

    /**
     * @param spaceChangeSize the spaceChangeSize to set
     */
    public void setSpaceChangeSize(long spaceChangeSize) {
        this.spaceChangeSize = spaceChangeSize;
    }

    /**
     * @return the sendSaveFlag
     */
    public byte getSendSaveFlag() {
        return sendSaveFlag;
    }

    /**
     * @param sendSaveFlag the sendSaveFlag to set
     */
    public void setSendSaveFlag(byte sendSaveFlag) {
        this.sendSaveFlag = sendSaveFlag;
    }

    /**
     * @return the saveToDra
     */
    public boolean isSaveToDra() {
        return saveToDra;
    }

    /**
     * @param saveToDra the saveToDra to set
     */
    public void setSaveToDra(boolean saveToDra) {
        this.saveToDra = saveToDra;
    }

    /**
     * @return the originalId
     */
    public Long getOriginalId() {
        return originalId;
    }

    /**
     * @param originalId the originalId to set
     */
    public void setOriginalId(Long originalId) {
        this.originalId = originalId;
    }

	public boolean isPopAuthFlag() {
		return popAuthFlag;
	}

	public void setPopAuthFlag(boolean popAuthFlag) {
		this.popAuthFlag = popAuthFlag;
	}

	public String getSmtpHost() {
		return smtpHost;
	}

	public void setSmtpHost(String smtpHost) {
		this.smtpHost = smtpHost;
	}   
	
}

